1. Field of the Invention
The present invention relates to a power management method for a computer system.
This application is based on Patent Application No. Hei 10-183067 filed in Japan, the contents of which are incorporated herein by reference.
2. Description of the Related Art
When a computer system is suspended for power management, the current states of the computer system may be maintained by continuously providing electricity to a memory (i.e., in a xe2x80x9csuspend-to-memoryxe2x80x9d method), or all the states of the computer system are stored on a hard disk (i.e., in a xe2x80x9csuspend-to-diskxe2x80x9d method). In the xe2x80x9csuspend-to-memoryxe2x80x9d method, the time necessary for the computer system to resume is shorter in comparison with the xe2x80x9csuspend-to-diskxe2x80x9d method. However, the information saved in the memory may be lost due to a short break (or interruption) in the power, and if the information is lost, the computer system cannot resume, that is, cannot be return to the previous state. In contrast, the xe2x80x9csuspend-to-diskxe2x80x9d method is not affected by a problem with the power, but needs a much longer time for resuming.
In consideration of the above problems, an objective of the present invention is to provide a power management method for a computer system, which is not affected by problems with the power and needs a shorter time for the computer system to resume from the suspended state.
Therefore, the present invention provides a power management method used in a computer system, in which data stored in a main memory is stored on a hard disk when the computer system enters a suspended state, wherein:
when the computer system resumes from the suspended state:
(i) if a power controller for controlling the power of the computer system has not been initialized after the computer system entered the suspended state, it is determined that no interruption of the AC power of the computer system occurred, and the computer system is made to resume the previous state before the suspension, based on the data stored in the main memory; and
(ii) if the power controller has been initialized, it is determined that an interruption of the AC power of the computer system occurred after the computer system entered the suspended state, and the data stored on the hard disk is read out and the computer system is made to resume the previous state before the suspension based on the readout data.
In the above method, when the computer system enters the suspended state, information indicating that the computer system is entering the suspended state is stored in a battery-backup memory; and it is determined that the computer system is resuming from the suspended state, based on the information stored in the battery-backup memory.
According to the present invention, if no problem with the AC power has occurred, the computer system can resume within a time as long as that necessary in the conventional xe2x80x9csuspend-to-memoryxe2x80x9d method, and even if data stored in the main memory is lost due to a problem with the AC power, the computer system can stably resume.